package relation;

import org.apache.hadoop.io.LongWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.*;

import java.io.IOException;

public class RelationMapper extends Mapper<LongWritable, Text, Text, Text> {
    public void map(LongWritable key, Text value, Context context) throws IOException, InterruptedException{
        String line = value.toString();
        String str[] =line.split(",");
        String parent = "parent";
        String child = "child";
        context.write(new Text(str[0]), new Text(parent + str[1]));
        context.write(new Text(str[1]), new Text( child + str[0]));
    }
}

